for proc in `ps -fe | grep logstash | grep -v grep | awk '{
  for(i=1; i<=NF; ++i) {
    match($i, /.+conf/, logstash_cfg);
    if(logstash_cfg[0] != "") {
      split(logstash_cfg[0],a,".")
      if(a[1] != "/")
        print a[1],$2;
    }
  }
}'`

do
    echo "$proc"|[ -n "`sed -n '/^[0-9][0-9]*$/p'`" ]
    if [ "$?" = "0" ];then                             
        # number of Up-process    
        process_num=$(($process_num+1))                   
    fi
done
echo $process_num
